#include <iostream>

using namespace std;

int main()
{ 
    double shuzu[99]; double insertnumber=0;
    int shuzu_number=0; int insertid =0;
    cin>>shuzu[shuzu_number++];
    cin>>shuzu[shuzu_number++];
    cin>>shuzu[shuzu_number++];
    cin>>shuzu[shuzu_number++];

    double t;
    //冒泡排序
    for(int i=0;i<shuzu_number;i++)
    {
        for(int j=0;j<shuzu_number-i-1;j++)
        {
            if(shuzu[j]<shuzu[j+1]){
                t=shuzu[j];
                shuzu[j]=shuzu[j+1];
                shuzu[j+1]=t;
            }

        }
    }

    //打印这个数组
    for(int i=0;i<shuzu_number;i++)
    {
        cout<<shuzu[i]<<endl;
    }
    cin>>insertnumber;

    //找到第一个比插入进来的大的元素，并将从最后一个元素开始，将数字复制到下一个元素中
    for (int i=0;i<shuzu_number;i++)
    {
        if(insertnumber>shuzu[i])
        {
            insertid=i;
            break;
        }
    }
    for (int i= shuzu_number -1;i>=insertid;i--)
    {
        shuzu[i+1]=shuzu[i];
    }

    shuzu[insertid]= insertnumber;


    //打印这个数组
    for(int i=0;i<shuzu_number +1;i++)
    {
        cout<<shuzu[i]<<endl;
    }
}
